package com.hqyj.Dao;
import com.hqyj.Pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
//数据处理，将数据原路返回
public interface LoginDao {
    //#{username}基于username参数动态改变限制条件
    @Select("SELECT * FROM user WHERE username=#{username}")
    List<User> queryByusername(String username);

    @Insert("INSERT into user (username,password,name,sex,mail,age,address,role_id,role_name,qiandao) VALUES" +
            " (#{username},#{password},#{name},#{sex},#{mail},#{age},#{address},#{role_id},#{role_name},#{qiandao})")
    void InsertUser(User users);

    @Update("UPDATE user SET qiandao=#{qiandao} WHERE username=#{username}")
    void setqiandao(User users);
}
